$(function(){
	 $("#collapseOne").hide();
	var sMenu =$("#sMenu").val();
	var mMenu = $("#mMenu").val();
	var mmMenu = $("#mmMenu").val();
	var basePath = $("#basePath").val();
	var kindurl = basePath +"view/TraderBook_BookKind/showBookKinds";
	var url = basePath ;
	var url1 =url + "index";
	var url2="";
	var url3 = "";
	 var first="";
	 var second = "";
	 var third = "";
	// alert(sMenu + "---" +mMenu + "----"+ mmMenu);
	switch(sMenu)
	{
	case "AcademyGK":
		switch(mMenu)
		{
		case "AcademyIntro":
			first='学院简介';
			
			break;
		case "OrgJG":
			first='组织机构';
		   
			break;
		case "other":
			first='组织机构';
			second="信息";
		    url2=basePath + "academygk/orgjg";
			break;
		case "syzx":
			first='实验中心';
		   
			break;
		case "xyzy":
			first='学院足音';
		   
			break;
		case "wyh":
			first='组织机构';
			second='委员会';
			url2=basePath + "academygk/orgjg";
			break;
		}
		break;
	case "intelligent":
		first="网际数计";
		break;
	case "learning":
		first='学习园地';
		switch(mMenu)
		{
		case "studentworkindex":
			break;
		case "other":
			url2=basePath+"studentwork/studentworkindex";
			second='信息';
			break;
		}
		break;
	case "studentwork":
		first='学生工作';
		switch(mMenu)
		{
		case "studentworkindex":
			
			
			break;
		case "other":
			url2=basePath+"studentwork/studentworkindex";
			second='信息';
		
			break;
		
		}
		break;
	case "djzc":
		first='党建之窗';
		switch(mMenu)
		{
		case "djzcindex":
			
			
			break;
		case "other":
			url2=basePath+"djzc/djzcindex";
			second='信息';
		
			break;
		
		}
		break;
	case "ScienceYJ":
		first='科学研究';
		switch(mMenu)
		{
		case "ScienceYJindex":
			
		
			break;
		case "other":
			url2=basePath +"rcpy/scienceyjindex";
			second='信息';
			
			break;
		case "xkjs":
			first='学科建设';
			switch(mmMenu){
		    case "other":
				url2=basePath + "rcpy/xkjs";
				second='信息';
				break;
		    }
			break;
		
		}
		break;
	case "teacherdw":
		first='师资队伍';
		switch(mMenu)
		{
		case "teacherdwindex":
			
		
			break;
		case "teacherintro":
			url2=basePath + "teacherdw/jxindex";
			second='教师简介';
			
			break;
		
		}
		break;
	case "image":
		$("#img11").attr("src",basePath+"images/error1.gif");
		$("#image").show();
		switch(mMenu)
		{
		
		case "addimage":
			first="特定图片添加"
				$("#adddimages").addClass("active");
			break;
		case "updateimage":
			
			first='更新图片';
			$("#imagemag").addClass("active");
			break;
         case "imagemag":
        	 $("#imagemag").addClass("active");
			first='管理图片';
			
			break;
		
		}
		break;
	case "rcpy":
		switch(mMenu)
		{
		case "bkpy":
			first='本科培养';
			switch(mmMenu){
		    case "other":
				url2=basePath + "rcpy/bkpy";
				second='信息';
				break;
		    }
			break;
		case "yjspy":
			first='研究生培养';
		    switch(mmMenu){
		    case "other":
				url2=basePath + "rcpy/yjspy";
				second='信息';
				break;
		    }
			break;
		case "ssd":
			   first='研究生培养';
		   
				url2=basePath + "rcpy/yjspy";
				second='硕士点';
			
			break;
		
		}
		break;
	case "jpkc":
		first = "精品课程";
		break;
	case "Filedownload":
		first = "下载中心";
		if(mMenu!="Filedownloadindex" && mMenu!=""){
			
			second = mMenu;
			url2 = basePath + "filedownload/filedownloadindex/1";
			id="#"+"file"+mmMenu;
			$(id).addClass("active");
		}
		if(mmMenu=="all"){
			$("#all").addClass("active");
		}
		break;
	case "xxydindex":
		
		first = "学习园地";
		second = mMenu;
		url2 = basePath + "learning/index_"+mmMenu+"/1";
		id="#"+"type"+mmMenu;
	//	alert(mMenu + "----"+mmMenu);
		$(id).addClass("active");
		break;	
	case "mooc":
		first = "mooc";
		break;
	case "index":
		break;
	case "nb":
		switch(mMenu)
		{
		case "newes":
			first = "新闻";
			switch(mmMenu)
			{
			  case "dj":
				$("#djnews").addClass("active");
				second="党建新闻";
				setURL2("djnews_1");
				break;
			  case "zsjy":
					$("#zsjynews").addClass("active");
					second="招生就业新闻";
					setURL2("zsjynews_1");
					break;
			  case "xsgz":
					$("#xsgznews").addClass("active");
					second="学生工作新闻";
					setURL2("xsgznews_1");
					break;
			  case "ky":
					$("#kynews").addClass("active");
					second="科研新闻";
					setURL2("kynews_1");
					break;
			  case "detail":
					second="新闻详细";
					setURL2("allnews_1");
					break;
			  case "yz":
				  $("#yz").addClass("active");
					second="研招新闻";
					setURL2("yzlnews_1");
					break;
			  case "jx":
				  $("#jx").addClass("active");
					second="教学新闻";
					setURL2("jxlnews_1");
					break;
			  case "all":
					$("#all").addClass("active");
					
					
					break;
			}
			break;
		case "bullets":
			first = "公告";
			switch(mmMenu)
			{
			  case "dj":
				$("#djb").addClass("active");
				second="党建公告";
				setURL2("djb_1");
				break;
			  case "zsjy":
					$("#zsjyb").addClass("active");
					second="招生就业公告";
					setURL2("zsjyb_1");
					break;
			  case "xsgz":
					$("#xsgzb").addClass("active");
					second="学生工作公告";
					setURL2("xsgzb_1");
					break;
			  case "xs":
					$("#xs").addClass("active");
					second="学术公告";
					setURL2("xsb_1");
					break;
			  case "bgjz":
					$("#bgjz").addClass("active");
					second="报告讲座";
					setURL2("bgjz_1");
					break;
			  case "detail":
					second="公告详细";
					setURL2("allbullet_1");
					break;
			  case "all":
					$("#all").addClass("active");
					
					
					break;
			}
			break;
		}
		break;
	
	case "zsjy":
		first = "招生就业";
		url2 = basePath+"zsjy/zsjyindex";
		switch(mMenu){
		case "other":
			second="信息";
			break;
        case "yxxy":
			second="优秀校友";
			break;	
		case "yxbys":
			//alert($("#collapseOne").is(":visible"));
			if($("#collapseOne").is(":visible") == false)
			{
				//alert("hi");
				 $("#collapseOne").show();
				$("#img").attr("src",basePath+"images/error1.gif");	
			}
			else {
				$("#img").attr("src",basePath+"images/add.gif");
			}
			$("#jb"+mmMenu).addClass("active");
			second="优秀毕业生";
			break;
		}
		break;
	case "login":
		first = "登录中心";
		break;
	case "newsandbullet":
		
		$("#img1").attr("src",basePath+"images/error1.gif");
		$("#newsui").show();
		switch(mMenu)
		{
		case "addnews":
			first='发布新闻';
			$("#addnews").addClass("active");
			break;
		case "newsmag":
			first='管理新闻';
			$("#newsmag").addClass("active");
			break;
		case "newsdetail":
			first = "新闻公告详细";
			break;
		}
	     break;
	case "teachermag":
		$("#img2").attr("src",basePath+"images/error1.gif");
		$("#teacherui").show();
		switch(mMenu)
		{
		case "addteachers":
			first="添加教师";
			$("#addtechers").addClass("active");
			break;
		case "teachermag":
			first="教师管理";
			$("#magtechers").addClass("active");
			break;
		}
		break;
	case "sciencedirection":
		$("#img8").attr("src",basePath+"images/error1.gif");
		$("#sciencedirection").show();
		switch(mMenu)
		{
		case "mgdirection":
			first="管理研究方向";
			$("#mgdirection").addClass("active");
			break;
		case "updatedirection":
			first="修改研究方向";
			$("#mgdirection").addClass("active");
			break;
		case "adddirection":
			first="添加研究方向";
			$("#adddirection").addClass("active");
			break;
			
		}
		break;
	case "researchlab":
		$("#img6").attr("src",basePath+"images/error1.gif");
		$("#rcpy").show();
		switch(mMenu)
		{
		case "mglab":
			first="管理研究所";
			$("#mglab").addClass("active");
			break;
		case "updatelab":
			first="修改研究所";
			$("#mglab").addClass("active");
			break;
		case "addlab":
			first="添加研究所";
			$("#addlab").addClass("active");
			break;
			
		}
		break;
	case "lab":
		$("#img9").attr("src",basePath+"images/error1.gif");
		$("#labmanage").show();
		switch(mMenu)
		{
		case "mglab":
			first="管理实验室";
			$("#mglabui").addClass("active");
			break;
		case "updatelab":
			first="修改实验室";
			$("#mglab").addClass("active");
			break;
		case "addlab":
			first="添加实验室";
			$("#addlabui").addClass("active");
			break;
			
		}
		break;
		
	case "bxxyd":
		$("#img9").attr("src",basePath+"images/error1.gif");
		$("#xxyd").show();
		switch(mMenu)
		{
		case "xxydmag":
			first="管理学习园地";
			$("#mgxxyd").addClass("active");
			break;
		case "updatexxyd":
			first="修改学习园地信息";
			$("#mgxxyd").addClass("active");
			break;
		case "addxxydui":
			first="添加学习园地信息";
			$("#addxxyd").addClass("active");
			break;
			
		}
		break;
	case "xxydtype":
		$("#img9").attr("src",basePath+"images/error1.gif");
		$("#xxyd").show();
		switch(mMenu)
		{
		case "xxydtypemag":
			first="管理学习园地类型";
			$("#mgxxydtype").addClass("active");
			break;
		case "updatexxydtype":
			first="修改学习园地类型";
			$("#mgxxydtype").addClass("active");
			break;
		case "addxxydtypeui":
			first="添加学习园地类型";
			$("#addxxydtype").addClass("active");
			break;
			
		}
		break;
	case "bmajor":
		$("#img7").attr("src",basePath+"images/error1.gif");
		$("#zy").show();
		switch(mMenu)
		{
		case "mgmajor":
			first="管理专业";
			$("#mgmajor").addClass("active");
			break;
		case "updatemajor":
			first="修改专业";
			$("#mgmajor").addClass("active");
			break;
		case "addmajor":
			first="添加专业";
			$("#addmajor").addClass("active");
			break;
			
		}
		break;
	case "department":
		$("#img10").attr("src",basePath+"images/error1.gif");
		$("#department").show();
		switch(mMenu)
		{
		case "mgdepartment":
			first="管理系部";
			$("#mgdepartment").addClass("active");
			break;
		case "updatedepartment":
			first="修改系部信息";
			$("#mgdepartment").addClass("active");
			break;
		case "adddepartment":
			first="添加系部";
			$("#adddepartment").addClass("active");
			break;
			
		}
		break;
	case "xy":
		$("#img4").attr("src",basePath+"images/error1.gif");
		$("#xyui").show();
		switch(mMenu)
		{
		case "magxy":
			first="管理校友";
			$("#magxy").addClass("active");
			break;
		case "updatemajor":
			first="修改专业";
			$("#mgmajor").addClass("active");
			break;
		case "addxy":
			first="添加校友";
			$("#addxy").addClass("active");
			break;
			
		}
		break;
	
	case "file":
		$("#img3").attr("src",basePath+"images/error1.gif");
		$("#file").show();
		switch(mMenu)
		{
		case "upload":
			first="上传文件";
			$("#upload").addClass("active");
			break;
		case "filemag":
			first="文件管理";
			$("#showfiles").addClass("active");
			break;
		}
		break;
	case "major":
		switch(mMenu)
		{
		case "math":
			first='数学与应用数学';
			$("#math").addClass("active");
			break;
		case "compute":
			first="计算机科学与技术";
			$("#compute").addClass("active");
			break;
		case "infoC":
			first="信息与计算科学";
			$("#infoC").addClass("active");
			break;
		case "software":
			first="软件工程";
			$("#software").addClass("active");
			break;
		}
		break;

	}
	var id = "#" +sMenu;
	$(id).addClass("active");
    //alert(first + " ----------" + second);
	showPosition(first,second,third);
	function setURL2(first){
		url2=url +sMenu+ "/"+ first ;
	}
	function getBookKind(firstid,secondid)
	{
		var sid = $("#sid").val();
		url2 = url + "TraderBook_Book/"+$("#dif").val()+"/"+firstid+"/" + sid+"/1";		
		second = $("#" + firstid).html();	
		third = $("#"+ secondid).html();
		$("#"+ secondid).addClass("active");
	}
	function showPosition(first,second,third)
	{
		var position = "";
		//alert(first);
		if(first=="" || first==null)
		{
			
		}else{
			if(second==null || second=="")
			{
				//alert(first + "2");
				//position = "当前位置:<a href='"+url1+"'>首页</a> >"+"<font style='color:#990000;font-size:15px;'>" +first+"</font>";
				position = "<strong>当前位置:</strong><a href='"+url1+"'>首页</a> >"+"<font style='color:#000;font-size:16px;' > " +first+"</font>";
				// alert(position);
			}else{
				if(third==null || third=="")
				{
					position = "<strong>当前位置:</strong><a href='"+url1+"'>首页</a> > <a href='"+url2+"'>"+first + "</a> > " +"<font style='color:#990000;font-size:15px;'>" +second +"</fon>";
				}else{
					position = "<strong>当前位置:</strong><a href='"+url1+"'>首页</a> > "+"<a href='"+kindurl+"'>图书分类</a> > " +"<a href='"+url2+"'>" + second+"</a> > "+"<font style='color:#990000;font-size:15px;'>"+ third +"</font>" ;
				}
			}
		}
		//alert(position);
		$("#position").html(position);
	//	alert($("#position").html());
	}
	
});
